package com.pdd.service;

import com.pdd.entity.Dept;
import com.pdd.mapper.DeptMapper;
import lombok.Data;

import java.util.List;

@Data
public class DeptServiceImpl implements DeptService {
    // 厨师找采购员
    private DeptMapper deptMapper;  // 依赖注入(set,构造器)

    @Override
    public List<Dept> selectAllDept() {
        return deptMapper.selectAllDept();
    }

    @Override
    public Dept selectOneById(int id) {
        return deptMapper.selectOneById(id);
    }

    @Override
    public Boolean deleteById(int id) {
        return deptMapper.deleteById(id) > 0;
    }

    @Override
    public void addOne(Dept dept) {
        deptMapper.addOne(dept);
    }

    @Override
    public void updateOne(Dept dept) {
        deptMapper.updateOne(dept);
    }
}
